package com.example.dubbonacosuserprovider.service;

import api.entity.User;
import api.service.UserService2;
import org.apache.dubbo.config.annotation.DubboService;
import org.apache.dubbo.rpc.RpcContext;
import org.springframework.stereotype.Service;

@Service
@DubboService(weight = 3)
public class UserServiceImpl implements UserService2 {
    @Override
    public void SaveUser(User user) {
//        RpcContext context = RpcContext.getContext();
//        System.out.println(context);
//        System.out.println(RpcContext.getServerAttachment().getAttachment("token"));
//        String token = RpcContext.getContext().getAttachment("token");
//        System.out.println(token);

        System.out.println("save user name is:"+user.getName()+" and password is:"+user.getPassword());
    }
}
